const {JSDOM} = require("jsdom") //导入jsdom模块
const jsdom = new JSDOM("<!doctype html><html><body></body></html>") //构造dom节点
const {window} = jsdom
Object.keys(window).forEach(property => { //将window对象参数绑定到global对象
    try {
        if (typeof global[property] === "undefined") {
            global[property] = window[property];
        }
    } catch (e) {
        console.log(e);
    }

})
window.navigator={
    //设置ua
    userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36"
}
global.tac="";

































